package vip.ifmm.entity;

import vip.ifmm.knapsack.enhancer.EnhancementAdapter;
import vip.ifmm.knapsack.entity.EnhanceInfo;

public class SimpleAdapter implements EnhancementAdapter {

    @Override
    public boolean preInvoke(EnhanceInfo enhanceInfo) {
        System.out.println("preInvoke");
        return false;
    }

    @Override
    public void postInvoke(EnhanceInfo enhanceInfo) {
        enhanceInfo.setResult(new Integer(100));
        System.out.println("postInvoke");
    }

    @Override
    public void postReturning(EnhanceInfo enhanceInfo) {
        enhanceInfo.setResult(new Integer(100));
        System.out.println("postReturning");
    }

    @Override
    public void postThrowing(EnhanceInfo enhanceInfo) {
        enhanceInfo.setResult(-1010);
        System.out.println("postThrowing");
    }
}
